﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StockInvCheckTime.aspx.cs"
    Inherits="StockInvCheckTime" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>店铺盘点时间监控报表</title>
    <script src="./../js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
        .x-grid-row-summary .x-grid-cell-Cost .x-grid-cell-inner
        {
            background-color: #e1e2e4;
        }
        .x-grid-row-summary .x-grid-cell-inner
        {
            font-weight: bold;
            font-size: 14px;
            background-color: #f1f2f4;
        }
    </style>
    <script>
        var areachange = function (obj) {
            //alert(obj.value);
            CompanyX.binStock(obj.value);
        }
        var saveData = function () {
            App.Hidden1.setValue(Ext.encode(App.GridPanel1.getRowsValues({ selectedOnly: false, currentPageOnly: true })));
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Neptune" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:Hidden ID="Hidden1" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="Container">
                            <Items>
                                <ext:Toolbar ID="Toolbar3" runat="server" Layout="ColumnLayout">
                                    <Items>
                                        <ext:DateField runat="server" ID="txtbdate" FieldLabel="上月日期" LabelWidth="60" />
                                        <ext:Label ID="Label4" runat="server" Text="-">
                                        </ext:Label>
                                        <ext:DateField runat="server" ID="txtedate" />
                                        <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info"
                                            Icon="Find">
                                            <DirectEvents>
                                                <Click Timeout="90000">
                                                    <EventMask ShowMask="true" Msg="加载中...">
                                                    </EventMask>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                        <ext:Component ID="Component2" runat="server" Width="1500" Padding="5">
                                        </ext:Component>
                                        <ext:ComboBox runat="server" ID="cbBigArea" FieldLabel="省份" DisplayField="BigAreaName"
                                            ValueField="BigAreaName" LabelWidth="60">
                                            <Store>
                                                <ext:Store runat="server" ID="Store2">
                                                    <Model>
                                                        <ext:Model ID="Model3" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="BigAreaName" />
                                                                <ext:ModelField Name="BigAreaName" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                            <Listeners>
                                                <Change Fn="areachange" />
                                            </Listeners>
                                        </ext:ComboBox>
                                        <ext:MultiCombo runat="server" ID="txtstock" FieldLabel="店铺" DisplayField="shopname"
                                            ValueField="shopid" LabelWidth="60">
                                            <Store>
                                                <ext:Store runat="server" ID="st_stock">
                                                    <Model>
                                                        <ext:Model ID="Model6" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="shopid" />
                                                                <ext:ModelField Name="shopname" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:MultiCombo>
                                        <ext:TextField runat="server" ID="txtshop" FieldLabel="店铺简称" LabelWidth="60" />
                                    </Items>
                                </ext:Toolbar>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="500" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model2" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="区域" ServerMapping="OperationAreaName" />
                                        <ext:ModelField Name="店铺编号" ServerMapping="ShopCode" />
                                        <ext:ModelField Name="店铺名称" ServerMapping="StockName" />
                                        <ext:ModelField Name="次数1月" ServerMapping="CheckCount_1" />
                                        <ext:ModelField Name="时间1月" ServerMapping="CheckTime_1" />
                                        <ext:ModelField Name="次数2月" ServerMapping="CheckCount_2" />
                                        <ext:ModelField Name="时间2月" ServerMapping="CheckTime_2" />
                                        <ext:ModelField Name="次数3月" ServerMapping="CheckCount_3" />
                                        <ext:ModelField Name="时间3月" ServerMapping="CheckTime_3" />
                                        <ext:ModelField Name="次数4月" ServerMapping="CheckCount_4" />
                                        <ext:ModelField Name="时间4月" ServerMapping="CheckTime_4" />
                                        <ext:ModelField Name="次数5月" ServerMapping="CheckCount_5" />
                                        <ext:ModelField Name="时间5月" ServerMapping="CheckTime_5" />
                                        <ext:ModelField Name="次数6月" ServerMapping="CheckCount_6" />
                                        <ext:ModelField Name="时间6月" ServerMapping="CheckTime_6" />
                                        <ext:ModelField Name="次数7月" ServerMapping="CheckCount_7" />
                                        <ext:ModelField Name="时间7月" ServerMapping="CheckTime_7" />
                                        <ext:ModelField Name="次数8月" ServerMapping="CheckCount_8" />
                                        <ext:ModelField Name="时间8月" ServerMapping="CheckTime_8" />
                                        <ext:ModelField Name="次数9月" ServerMapping="CheckCount_9" />
                                        <ext:ModelField Name="时间9月" ServerMapping="CheckTime_9" />
                                        <ext:ModelField Name="次数10月" ServerMapping="CheckCount_10" />
                                        <ext:ModelField Name="时间10月" ServerMapping="CheckTime_10" />
                                        <ext:ModelField Name="次数11月" ServerMapping="CheckCount_11" />
                                        <ext:ModelField Name="时间11月" ServerMapping="CheckTime_11" />
                                        <ext:ModelField Name="次数12月" ServerMapping="CheckCount_12" />
                                        <ext:ModelField Name="时间12月" ServerMapping="CheckTime_12" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" />
                            <ext:Column ID="Column1" runat="server" Text="区域" DataIndex="区域" Locked="True" />
                            <ext:Column ID="Column2" runat="server" Text="店铺编号" DataIndex="店铺编号" Width="120"
                                Locked="True" />
                            <ext:Column ID="Column3" runat="server" Text="店铺名称" DataIndex="店铺名称" Width="150"
                                Locked="True" />
                            <ext:Column ID="Column6" runat="server" Text="1月">
                                <Columns>
                                    <ext:Column ID="Column7" runat="server" Text="次数" DataIndex="次数1月" Width="60" />
                                    <ext:Column ID="Column8" runat="server" Text="时间" DataIndex="时间1月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column9" runat="server" Text="2月">
                                <Columns>
                                    <ext:Column ID="Column10" runat="server" Text="次数" DataIndex="次数2月" Width="60" />
                                    <ext:Column ID="Column11" runat="server" Text="时间" DataIndex="时间2月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column12" runat="server" Text="3月">
                                <Columns>
                                    <ext:Column ID="Column13" runat="server" Text="次数" DataIndex="次数3月" Width="60" />
                                    <ext:Column ID="Column14" runat="server" Text="时间" DataIndex="时间3月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column15" runat="server" Text="4月">
                                <Columns>
                                    <ext:Column ID="Column16" runat="server" Text="次数" DataIndex="次数4月" Width="60" />
                                    <ext:Column ID="Column17" runat="server" Text="时间" DataIndex="时间4月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column18" runat="server" Text="5月">
                                <Columns>
                                    <ext:Column ID="Column19" runat="server" Text="次数" DataIndex="次数5月" Width="60" />
                                    <ext:Column ID="Column20" runat="server" Text="时间" DataIndex="时间5月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column21" runat="server" Text="6月">
                                <Columns>
                                    <ext:Column ID="Column22" runat="server" Text="次数" DataIndex="次数6月" Width="60" />
                                    <ext:Column ID="Column23" runat="server" Text="时间" DataIndex="时间6月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column24" runat="server" Text="7月">
                                <Columns>
                                    <ext:Column ID="Column25" runat="server" Text="次数" DataIndex="次数7月" Width="60" />
                                    <ext:Column ID="Column26" runat="server" Text="时间" DataIndex="时间7月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column27" runat="server" Text="8月">
                                <Columns>
                                    <ext:Column ID="Column28" runat="server" Text="次数" DataIndex="次数8月" Width="60" />
                                    <ext:Column ID="Column29" runat="server" Text="时间" DataIndex="时间8月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column30" runat="server" Text="9月">
                                <Columns>
                                    <ext:Column ID="Column31" runat="server" Text="次数" DataIndex="次数9月" Width="60" />
                                    <ext:Column ID="Column32" runat="server" Text="时间" DataIndex="时间9月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column33" runat="server" Text="10月">
                                <Columns>
                                    <ext:Column ID="Column34" runat="server" Text="次数" DataIndex="次数10月" Width="60" />
                                    <ext:Column ID="Column35" runat="server" Text="时间" DataIndex="时间10月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column36" runat="server" Text="11月">
                                <Columns>
                                    <ext:Column ID="Column37" runat="server" Text="次数" DataIndex="次数11月" Width="60" />
                                    <ext:Column ID="Column38" runat="server" Text="时间" DataIndex="时间11月" Width="150" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column39" runat="server" Text="12月">
                                <Columns>
                                    <ext:Column ID="Column40" runat="server" Text="次数" DataIndex="次数12月" Width="60" />
                                    <ext:Column ID="Column41" runat="server" Text="时间" DataIndex="时间12月" Width="150" />
                                </Columns>
                            </ext:Column>
                        </Columns>
                    </ColumnModel>
                    <Features>
                        <ext:Summary ID="Summary1" runat="server">
                        </ext:Summary>
                    </Features>
                    <SelectionModel>
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="500" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="500" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel" Visible="false">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="Button3" runat="server" Text="导出(当前页)" AutoPostBack="true" OnClick="ToExcel"
                                    Visible="false" Icon="PageExcel">
                                    <Listeners>
                                        <Click Fn="saveData" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="Button4" runat="server" Text="导出EXCEL" OnDirectClick="BtnOutExcel"
                                    UI="Info" Visible="true" Icon="PageExcel">
                                    <DirectEvents>
                                        <Click Timeout="90000">
                                            <EventMask ShowMask="true" Msg="正在生成下载文件...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                    <Listeners>
                        <AfterLayout Handler="#{ToolbarDroppable1}.addDDGroup(this.child('headercontainer').reorderer.dragZone.ddGroup); doSort();"
                            Single="true" />
                    </Listeners>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
